<?php
@header("content-type:text/html;charset=utf-8");

@include_once("conn.php");
@include_once("common.php");//和 mysql数据库建立连接

$email=$_GET["email"];
if(!($email)){
    paramsErr();
}
$sql = "select * from `userinfo` where user = '$email'";
$result = mysqli_query($conn,$sql);
if(!($result)){
    $obj=array();
    $obj["status"]=false;
    $obj["detail"]="sql语句执行错误";
    $obj["sql"]=$sql;
    exit(json_encode($obj)) ;
}
$item = mysqli_fetch_assoc($conn,$result);
$obj= array();
if(!($item)){
    $obj["status"]=true;
    $obj["detail"]="注册成功";
}else{
    $obj["status"]=false;
    $obj["detail"]="该用户名已经注册!";
}
echo json_encode(obj);
?>